package com.yzl.factory.abs;

import com.yzl.factory.abs.ali.AliOrderFactory;
import com.yzl.factory.abs.wechat.WechatOrderFactory;

/**
 * @program: design-pattern
 * @description: 超级工厂
 * @author: YaoZhiLi
 * @create: 2021-08-02 23:41
 */
public class FactoryProducer {
    public static OrderFactory getFactory(String type) {
        if (type == null) {
            return null;
        }
        if (type.equalsIgnoreCase("WECHAT PAY")) {
            return new WechatOrderFactory();
        }
        if (type.equalsIgnoreCase("ALI PAY")) {
            return new AliOrderFactory();
        }
        return null;

    }
}